﻿<include file="top" />
<div class="submenu"><a href="?m=Groups" class="current">粉丝分组管理</a> | <a href="?m=Subscriber&a=getalluser" onclick="return window.confirm('确定要同步粉丝信息吗？');">同步粉丝信息</a></div>
<form>
<table width="100%">
	<tr class="h"><td>昵称</td><td>性别</td><td>位置</td><td>关注</td><td>关注时间</td><td>最后消息</td><td>对话模式</td><td>操作</td></tr>
<loop name="Subscriber">
	<tr class="l"><td><a onclick="ShowDetail({$Subscriber.Id});"><img src="{$Subscriber.Headimgurl:ReplaceEx="\/(\d+)$","/64"}" width="24" height="24" /> {$Subscriber.NickName}</a></td>
		<td><switch name="Subscriber.Sex"><case value="1"/>男<case value="2"/>女<default />未知</switch></td>
		<td>{$Subscriber.County} {$Subscriber.Province} {$Subscriber.City}</td>
		<td><eq name="Subscriber.Subscribe" value="0">未关注</else>已关注</eq></td>
		<td>{$Subscriber.SubscribeTime:F.untimespan}</td><td>{$Subscriber.LastMessageTime:F.untimespan}</td><td>{$Subscriber.Mode}</td><td>
		<a href="?m=Messages&OpenId={$Subscriber.OpenId}">来往</a>&nbsp;|&nbsp;
		<a href="javascript:GotoPage('{$Subscriber.OpenId}',1,'{$Subscriber.NickName:F.encode}')">踪迹</a>&nbsp;|&nbsp;
		<expression and="Subscriber.LastMessageTime gt Now as assign">
		<a onclick="ShowReply('{$Subscriber.OpenId}');return false;">回复</a>&nbsp;|&nbsp;
		</expression>
		<a href="?m=Subscriber&a=delete&Id={$Subscriber.Id}" onclick="return window.confirm('确定删除粉丝吗？');">删除</a></td>
	</tr>
</loop>
	<tr class="l"><td colspan="8"><page for="Subscriber" /></td></tr>
</table>
</form>
<script type="text/javascript">
function ShowDetail(id){
	ShowTips("提示","正在加载...");
	Ajax({
		url:"?m=Subscriber&a=view&Id=" + id,
		succeed:function(msg){
			CloseTips();
			F("#DialogAlert").attr("title","粉丝详细信息").html(msg).dialog({
				"width":500,"height":480,"maxHeight":800,buttons:{
					"确定":function(){}
				},afterOpen:function(){
					if(F("#NickNameAndId").length()>0)F("#DialogAlert").dialog("title",F("#NickNameAndId").html());
				}
			});
		}
	});
}
function GotoPage(OpenId,page,nickname){
	ShowTips("提示","正在加载...");
	Ajax({
		url:"?m=Subscriber&a=locations&OpenId=" + OpenId + "&page=" + page,
		nickname:nickname,
		succeed:function(msg){
			CloseTips();
			if(F("#locations").length()>0){
				F("#locations").html(msg);
				F("#DialogAlert").dialog("title","粉丝踪迹：" + F.decode(this.nickname));
				F("#DialogAlert").dialog("open");
			}else{
				F("#DialogAlert").attr("title","粉丝踪迹：" + F.decode(this.nickname)).html("<div id=\"locations\">"+msg+"</div>").dialog({
					"width":570,"height":480,"maxHeight":800,buttons:null
				});
			}
		},
		error:function(){ShowTips("提示","加载失败。",1000);}
	});
}
function ModGroup(frm){
	Ajax({
		form:frm,
		succeed:function(msg){
			ShowTips("提示",msg,1000);
		}
	});		
}
function UserAction(a,id){
	Ajax({
		url:"?m=Subscriber&a=" + a + "&Id=" + id,
		id:id,
		a:a,
		succeed:function(msg){
			ShowTips("提示",msg,1000);
			if(this["a"]=="getuser"){
				var func = (function(id){return function(){ShowDetail(id);};})(this["id"]);
				window.setTimeout(func, 1000)
			}
		}
	});	
}
</script>
<js file="/Contents/Scripts/jquery.min.js" />
<js file="/Contents/Scripts/wxeditor.js" />
<div id="DialogAlert"></div>
<include file="foot" />